//
//  JEHDetailCollectionViewCell.m
//  SinaNews
//
//  Created by 蒋恩浩 on 15/12/9.
//  Copyright © 2015年 JEH. All rights reserved.
//

#import "JEHDetailCollectionViewCell.h"

@interface JEHDetailCollectionViewCell ()

@property (nonatomic, retain) UIImageView *picture;

@end

@implementation JEHDetailCollectionViewCell

- (void)dealloc
{
    [_secondModel release];
    [_picture release];
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createView];
    }
    return self;
}

- (void)createView {
    
    self.picture = [[UIImageView alloc] initWithFrame:CGRectZero];
    [_picture release];
    _picture.contentMode = UIViewContentModeScaleAspectFit;
    _picture.clipsToBounds = YES;
    [self addSubview:_picture];
}

- (void)setSecondModel:(JEHSecondModel *)secondModel {
    if (_secondModel != secondModel) {
        [_secondModel release];
        _secondModel = [secondModel retain];
    }
    [self.picture sd_setImageWithURL:[NSURL URLWithString:secondModel.kpic] placeholderImage:[UIImage imageNamed:@"placeholderImage"]];
}

- (void)layoutSubviews {
    [super layoutSubviews];
    self.picture.frame = self.bounds;
}




/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
